package com.wangyadong.hobby.schedule.jobtask.javasync.Observerable;

/**
 * <p>
 *
 * @author <714037465@qq.com>
 * @since 2018/11/1512:39
 **/
public interface TaskLife<T> {
    void onStart(Thread thread);

    void onRunning(Thread thread);

    void onFinsh(Thread thread, T result);

    void onError(Thread thread, Exception e);

    public static class EmptyTaskLife implements TaskLife {
        @Override
        public void onStart(Thread thread) {
        }

        @Override
        public void onRunning(Thread thread) {
        }

        @Override
        public void onFinsh(Thread thread, Object result) {
        }

        @Override
        public void onError(Thread thread, Exception e) {
        }
    }

}
